<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			img {
				width: 300px;
			}
		</style>
	</head>
	<body>
		<img src="./img/06.jpg">
		<div>
			上午好
		</div>
		<script type="text/javascript">
			var img = document.querySelector('img');
			var div = document.querySelector('div');
			var date = new Date();
			var h = date.getHours();
			console.log(h);
			if (h < 12) {
				img.src = './img/06.jpg';
				div.innerHTML = '上午好啊';
			} else if (h < 18) {
				img.src = './img/15.jpg'
				div.innerHTML = '中午好啊';
			} else {
				img.src = './img/13.jpg';
				div.innerHTML = '晚上好啊';
			}
		</script>
	</body>
</html>
